{extend name="../../admin/view/main"}
{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white">
    <form class="layui-form layui-card" action="" data-auto="true" method="post" autocomplete="off">
        <div class="layui-row layui-col-space10" style="padding: 30px 0px;">
            {foreach $formFields['base'] as $key=>$vo}
            <div class="layui-form-item">
                <label class="layui-form-label">{$vo.title}</label>
                <div class="layui-input-block">
                    {$vo.form|raw}
                </div>
            </div>
            {/foreach}
        </div>
        <div class="hr-line-dashed"></div>
        {notempty name='id'}<input type='hidden' value='{$id}' name='id'>{/notempty}
        <div class="layui-form-item text-center">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveData">保存数据</button>
            <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
        </div>
    </form>
</div>
{/block}
{block name='style'}
<link rel="stylesheet" href="__ROOT__/static/plugs/layui/mods/formSelects-v4.css">
<link rel="stylesheet" href="__ROOT__/static/plugs/layui/mods/cascader.css">
{/block}
{block name='script'}
<script>
    layui.form.render();
    layui.config({
        base: "__ROOT__/static/plugs/layui/mods/"
    });
    layui.use(['jquery', 'form'{if $layuiJsModels neq ''},"{$layuiJsModels|raw}"{/if}], function () {
        var layer = layui.layer,
            $ = layui.jquery,
            {$layuiJSinit|raw}
        form = layui.form;

        {$dependJS|raw}

        form.on('submit(saveData)', function (data) {
            {$formValidator|raw}
            {$formData|raw}
            $.msg.success('模拟表单提交成功');
            //拦截layui自带的提交
            return false;
        });
    });

</script>
{/block}